home *** CD-ROM | disk | FTP | other *** search
/ The Hacker Chronicles - A…the Computer Underground / The Hacker Chronicles - A Tour of the Computer Underground (P-80 Systems).iso / miscpub2 / uxu-014.txt < prev    next >
Text File  |  1992-09-26  |  40KB  |  876 lines

  1.  
  2. <><><><><><><><><><><><><><><><><><><>!<><><><><><><><><><><><><><><><><><><><>
  3. #%       ..uXu..                                                   1991      %#
  4. %#                       Underground eXperts United                          #%
  5. #%                                presents...                                %#
  6. %#                                  -=*=-                                    #%
  7. #%                 The European Digest Series Vol.1 Issue #5                 %#
  8. %#        1991                  By THE CHIEF                      ..uXu..    #%
  9. <><><><><><><><><><><><><><><><><><><>!<><><><><><><><><><><><><><><><><><><><>
  10.  
  11.        SPECIAL MANUAL ISSUE    -   SCO XENIX System V TUTORIAL CHAPTER #2
  12.  
  13.                                   Contents...
  14.  
  15.                           01.............Introduction
  16.                           02.............Contents In Chapter Two
  17.                           03.............Xenix Tutorial Chapter Two
  18.                           04.............Recommended
  19.                           05.............End Comments
  20.  
  21.  
  22.  
  23.  
  24.  1. INTRODUCTION
  25.  ---------------
  26.  Welcome to TED Vol.1 Issue #5 - The uXu File #14!
  27.  The second part of the SCO XENIX V Tutorial manual is ready for TED, and
  28.  here it is for you. This section will cover the Basic concepts in XENIX
  29.  like some usual commands, som names/directories to know, and things the
  30.  beginner must know, for starters. Like before, if you're an unix/xenix
  31.  guru, or just if you have some basic knowledge of unix/xenix, you can
  32.  skip this chapter, and just keep it as a reference. This is, still, for
  33.  the beginner. The next chapter in the Xenix Tutorial Manual will cover
  34.  how to login to the system, some security tips, and more commands.
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  2. CONTENTS IN CHAPTER TWO
  41.  --------------------------
  42.  
  43.                  2.0 BASIC CONCEPTS
  44.                      2.1...Introduction
  45.                      2.2...Accounts
  46.                            2.2.1.....User Accounts
  47.                            2.2.2.....Super User Account
  48.  
  49.                      2.3...Files
  50.                            2.3.1.....Ordinary Files
  51.                            2.3.2.....Special Device Files
  52.                            2.3.3.....Directory Files
  53.                            2.3.4.....Directory Structure
  54.  
  55.                      2.4...Naming Conventions
  56.                            2.4.1.....Filenames
  57.                            2.4.2.....Pathnames
  58.                            2.4.3.....Sample Names
  59.                            2.4.4.....Special Characters
  60.  
  61.                      2.5...Commands
  62.                            2.5.1.....Command Line
  63.                            2.5.2.....Syntax
  64.  
  65.                      2.6...Input And Output
  66.                            2.6.1.....Redirection
  67.                            2.6.2.....Pipes
  68.  
  69.  
  70.  
  71.  3. XENIX TUTORIAL CHAPTER TWO
  72.  -----------------------------
  73.  
  74.  
  75. 2.0                            BASIC CONCEPTS                               2.0
  76. ===============================================================================
  77. 2.1 Introduction                                               2.1 Introduction
  78. ===============================================================================
  79.  
  80.    This chapter explains the basic concepts that you need to understand to
  81. work effectively in the XENIX environment. After reading this chapter, you
  82. should understand the fundamentals of user accounts, as well as how the 
  83. system's files and directories are organized and named, how commands are
  84. entered, and how a command's input andoutput can be redirected. It is important
  85. to read this chapter before proceeding to the tutorial chapters that follow.
  86.  
  87. 2.2                               ACCOUNTS                                  2.2
  88. ===============================================================================
  89. 2.2.1 User Accounts                                         2.2.1 User Accounts
  90. ===============================================================================
  91.  
  92.    An account must be created for you before you can log on to a XENIX system.
  93. Your account contains the following information:
  94.  
  95.      *   Your login name. This is the name by which you are known in the
  96.          system. It is the name you enter at the login prompt.
  97.  
  98.      *   Your password. To increase system security, each user may be
  99.          given a password. This password is entered when you log on to the
  100.          system.
  101.  
  102.      *   Your group identification. Each user is known to the system as an
  103.          individual and as a member of a group. Group membership is important
  104.          for system security reasons. As a member of a group, you may be
  105.          permitted to access files and directories that you cannot access
  106.          as an individual.
  107.  
  108.      *   Your "home directory." This is the place in the filesystem where
  109.          you can keep personal files. When you first log on in to the system,
  110.          you are placed in your home directory.
  111.  
  112.      *   Your "login shell." This is the program that reads and executes the
  113.          XENIX commands you input. In most cases, your login shell will be the
  114.          "Bourne Shell." The Bourne Shell uses the dollar sign ($) as a prompt.
  115.          However, you may be configured to use the "C-Shell," which uses the
  116.          percent sign (%) as a prompt, or the "Visual Shell," which is a menu-
  117.          driven interface. Throughout this tutorial, the expression "XENIX 
  118.          prompt" is used to refer to your shell prompt, wether it is the
  119.          percent sign or the dollar sign.
  120.  
  121.    Once an account has been established for you, you can manipulate the files,
  122. directories, and commands that make up the XENIX system.
  123.  
  124. ===============================================================================
  125. 2.2.2 Super User Account                               2.2.2 Super User Account
  126. ===============================================================================
  127.  
  128.    In addition to each user's individual account, every XENIX system has a
  129. "super user" account. (The super user is also referred to as "root.") In
  130. order to perform certain system administration tasks, the system administraror
  131. must log in as the super user. The super user has free rein over the system.
  132. The super user can read and edit any file on the system, as well as execute
  133. any program.
  134.  
  135. ===============================================================================
  136. 2.3 Files                                                             2.3 Files
  137. ===============================================================================
  138.  
  139.    The file is the fundamental unit of the XENIX filesystem. There are three
  140. different types of XENIX files: ordinary files (what we usually mean when we
  141. say "file"), special device files, and directories. Each of these is described
  142. in the sections that follow.
  143.  
  144. ===============================================================================
  145. 2.3.1 Ordinary Files                                       2.3.1 Ordinary Files
  146. ===============================================================================
  147.  
  148.    An ordinary file is simply a collection of 8-bit bytes. Ordinary files are
  149. usually documents, program source code, or program data. Executable binary
  150. files, or computer programs, are also considered ordinary files. The bytes
  151. of an ordinary file are interpreted as text characters, binary instructions,
  152. or program statements, by the programs that examine them.
  153.  
  154.    Every ordinary file has the following attributes:
  155.  
  156.      *   a filename (not necessarily unique),
  157.  
  158.      *   a unique filesystem number called an inode number,
  159.  
  160.      *   a size in bytes,
  161.  
  162.      *   a time of last change,
  163.  
  164.      *   a set of access permissions,
  165.  
  166.      *   an owner and a group.
  167.  
  168.    File Protection
  169.  
  170.    On a multi-user system, it is often necessary to "protect" certain files,
  171. denying some users access to the files while allowing access to others. Files
  172. are protected by assigning appropriate "access permissions" to them. XENIX
  173. provides three levels of access permissions:
  174.  
  175.       read        Having read permission on a file allows a user to view
  176.                   the contents of the file with such commands as <cat> and
  177.                   <more>. A user with read-only permission cannot edit a file.
  178.  
  179.       write       Having write permission on a file allows a user to edit
  180.                   the file.
  181.  
  182.       execute     If the file is a program, having execute permission on the
  183.                   file allows a user to run the program. You cannot run a
  184.                   program for which you do not have execute permission.
  185.  
  186.    Access permissions are assigned by a file's owner. (By default, the owner
  187. of a file is its creator.) Any combination of the three levels is permitted.
  188. This allows the file's owner to determine which users can read, write and/or
  189. execute the file. Note that the super user has readm write and execute
  190. permissions on all files on the system.
  191.  
  192.    The file security mechanism implemented under XENIX is very flexible. It
  193. allows separate access permissions to be set for a file's owner, a file's
  194. group, and for all other users. In a typical case the, owner of a file might
  195. have read and write permissions, the group read-only permission, and all other
  196. users no access permissions at all.
  197.  
  198. ===============================================================================
  199. 2.3.2 Special Device Files                           2.3.2 Special Device Files
  200. ===============================================================================
  201.  
  202.    Each physical device on the system, such as hard and floppy disks, line-
  203. printers, terminals, and system memory, is assigned to a "special file."
  204. These files are also called "special device files." Special device files are
  205. not discussed in this tutorial. (For more information on special device files,
  206. see the XENIX System Administrator's Guide, also published by Swedish Hackers
  207. Association.)
  208.  
  209. ===============================================================================
  210. 2.3.3 Directory Files                                     2.3.3 Directory Files
  211. ===============================================================================
  212.  
  213.    Directory files are more like file drawers than files. They are places
  214. where files are stored (conceptually, not physically). Directory files are
  215. usually referred to as "directories."
  216.  
  217.    A directory contains the names and inode numbers of the files "within it."
  218. These inode numbers point to "inodes." XENIX uses inodes internally to
  219. organize filesystems. There is one inode per file. Inodes contain information
  220. about files. This information includes the file type, the number of links to
  221. the file, the location of the file on the disk, the size of the file, the
  222. identity of the file's owner and group, the file's access permissions, and
  223. the time the file was last modified.
  224.  
  225.    Like ordinary files, directories can be protected by assigning appropriate
  226. access permissions. These are read, write and execute. In order to do
  227. anything useful in a directorym a user must have execute permission on that
  228. directory, Execute and write permissions determine whether files can be added
  229. to or removed from a directory. Execute and read permissions determine whether
  230. the contents of a directory can be listed. Access permissions are assigned to
  231. a directory by its owner. By default, the owner of a directory is its creator.
  232.  
  233. ===============================================================================
  234. 2.3.4 Directory Structure                             2.3.4 Directory Structure
  235. ===============================================================================
  236.  
  237.    With multiple users working on multiple prohjects, the number of files
  238. in a filesystem can proliferate rapidly, creating an organizational nightmare.
  239. The inverted "tree-structured" directory hierarchy that is a feature of the
  240. XENIX system allows users to organize large numbers of files efficiently.
  241. Related files, a directroy can contain other directories, sometimes called
  242. "subdirectories." Subdirectories themselves can contain ordinary files and
  243. more subdirectories, and so on. The <cd> command is used to move from one
  244. directory to another.
  245.  
  246.    In this typical tree of files, the root of the tree is at the top and the
  247. branches of the tree grow downward. Directories correspond to "nodes" in the
  248. tree, while ordinary files correspond to "leaves." Figure 2-1 represent this
  249. inverted tree-structured directory hierarchy.
  250.  
  251.  
  252.                                 / (root)
  253.                                     |
  254.                  ---------------------------------------
  255.                  |                    |                |
  256.                 bin                  usr              dev
  257.                  |                    |                |
  258.                  |             --------------          |
  259.                  |             |            |          |
  260.                chmod         gwenl        markt      tty1a
  261.                                |            |
  262.                        --------------   -------------
  263.                        |            |   |           |
  264.                      mail         news text        data
  265.  
  266.  
  267.                       FIGURE 2-1  A Typical Filesystem
  268.  
  269.  
  270.  
  271.    In figure 2-1, the names [bin], [usr], [dev], [gwenl], and [markt] all
  272. represent directories, and are all nodes in the tree. At the top of the tree
  273. is the root directory, which is given the name slash (/). The names [mail],
  274. [news], [text], and [data] all represent ordinary files, and they are all
  275. "leaves" of the tree.  The file [chmod] is the name of a command that can
  276. be executed. The name [tty1a] is a special device file. It represents a 
  277. terminal and is also represented in the tree.
  278.  
  279.    If a directory contains a downward branch to other files or directories,
  280. those files and directories are "contained" in the given directory, All
  281. directories and files on the system are contained in the root directory. In
  282. Figure 2-1, the files [mail] and [news] are contained in the directory [gwenl],
  283. which itself is contained in the directoty [usr]. The directory [usr], in turn,
  284. is contained in the root directory.
  285.  
  286.    It is possible to name any file in the system by starting at the root and
  287. traveling down any of the branches to the desired file. Files can also be
  288. named relative to any directory. XENIX naming conventions are discussed later
  289. in this chapter.
  290.  
  291.    THE USER DIRECTORY
  292.  
  293.    Each XENIX user is given a personal or "home" directory. This is a place
  294. where you can keep files that no other user is likely to need. Within the
  295. home directory, you may have other subdirectories that you own and control.
  296. All of the home directories on a XENIX system are often placed in the [usr]
  297. directory, as illustrated by Figure 2-2.
  298.  
  299.  
  300.                                     usr
  301.                                      |
  302.              --------------------------------------------------
  303.              |                           |                    |
  304.            adam                         eve                  mary
  305.              |                           |                    |
  306.              |                   -----------------            |
  307.              |                   |               |            |
  308.            text                 text           temp          text
  309.  
  310.  
  311.                       FIGURE 2-2  A Typical User Directory
  312.  
  313.  
  314.    In Figure 2-2, the [usr] directory contains each user's home directory.
  315. There are three users on this system, [adam], [eve], and [mary].
  316.  
  317. ===============================================================================
  318. 2.4 Naming Conventions                                   2.4 Naming Conventions
  319. ===============================================================================
  320.  
  321.    Every single file, directory, and device in XENIX has both a filename and
  322. a pathname. Filenames and pathnames are discussed in the following two
  323. sections.
  324.  
  325. ===============================================================================
  326. 2.4.1 Filenames                                                 2.4.1 Filenames
  327. ===============================================================================
  328.  
  329.    A filename is a sequence of 1 to 14 characters consisting of letters,
  330. digits and other special characters such as the underbar (_). Every single
  331. file, directory, and device in the system has a filename, it is best to
  332. confine filenames to the alphanumeric characters and the period. Other
  333. characters, especially control characters, are discouraged for use in
  334. filenames.
  335.  
  336.    Filenames should be indicative of a file's contents. For example, a file
  337. containing purchase orders should have a name like [orders], rather than
  338. [file1]. Note that filenames must be unique only within directories and need
  339. not be unique system-wide. Different directories can contain different files
  340. that have the same name. For example, there can be several files named [text]
  341. on a single system, as long as those files are each in separate directories.
  342.  
  343.    When a filename contains an initial period, it is "hidden," and is not
  344. displayed by the <lc> command. System configuration files are often hidden.
  345. However the <lc -a> command does display hidden files. The dash (-) is used
  346. in specifying command options and should be avoided when naming files. In
  347. addition, the question mark (?), the asterisk (*), brackets ([ and ]), and
  348. all quotation marks should Never be used in filenames, because they have
  349. special meaning to the XENIX shell. (For more information on these
  350. characters, see "Special Characters" later in this chapter.)
  351.  
  352. ===============================================================================
  353. 2.4.2 Pathnames                                                 2.4.2 Pathnames
  354. ===============================================================================
  355.  
  356.    A pathname is a sequence of directory names followed by a simple filename,
  357. each separated from the previous name by a slash. If a pathname begins with
  358. a slash, it specifies a file that can be found by beginning a search at the
  359. root of the entire tree. Otherwise, files are found by beginning the search
  360. at the user's Current Directory (also known as the Working Directory). The
  361. <pwd> command is used to print the name of the working directory on the
  362. screen.
  363.  
  364.    A pathname beginning with a slash is called a "full" or "absolute
  365. pathname". The absolute pathname is a map of of a file's location in the
  366. system. Absolute pathnames are unique: no two files, directories or devices
  367. have the exact same absolute pathname. A pathname Not beginning with a slash
  368. is called a "relative pathname", because it specifies a path relative to the
  369. current directory.
  370.  
  371. ===============================================================================
  372. 2.4.3 Sample Names                                           2.4.3 Sample Names
  373. ===============================================================================
  374.  
  375.    Among the directory and file names commonly found on XENIX systems are:
  376.  
  377.  
  378.    /                       The name of the root directory.
  379.  
  380.    /bin                    The directory containing most of the frequently
  381.                            used XENIX commands.
  382.  
  383.    /usr                    The directory containing each user's personal
  384.                            directory. The subdirectory, [/usr/bin] contains
  385.                            frequently used XENIX commands not in [/bin].
  386.  
  387.    /dev                    The directory containing special device files.
  388.  
  389.    /dev/console            The special device file associated with the system
  390.                            console.
  391.  
  392.    /dev/ttyXX              The names of special device files associated with
  393.                            system ports. XX represents a number, such as 1A
  394.                            or 006. Most ports are assigned to terminals.
  395.  
  396.    /lib                    The directory containing files of "libraries" used
  397.                            for system development.
  398.  
  399.    /usr/lib                The directory containing directories with XENIX
  400.                            applications.
  401.  
  402.    /tmp                    The directory for temporary files.
  403.  
  404.    /usr/joe/run            A typical full pathname. It is the pathname of a
  405.                            file named [run] belonging to a user named [joe].
  406.  
  407.    bin/script              A relative pathname. It names the file [script]
  408.                            in subdirectory [bin] of the current working
  409.                            directory. If the current directory is the root
  410.                            directory (/), it names [/bin/script]. If the
  411.                            current directory is [/usr/joe], it names
  412.                            [/usr/joe/bin/script].
  413.  
  414.    file1                   Name of an ordinary file in the current directory.
  415.  
  416.    All files and directories, with the exception of the root directory, have a
  417. "parent" directory. This directory is located immediately above the given file
  418. or directory. The XENIX filesystem provides special shorthand notations for
  419. the parent directory and for the current directory:
  420.  
  421.  
  422.    .                       The shorthand name of the current directory.
  423.                            For example, [./filexxx] names the same file
  424.                            as [filexxx], in the current directory.
  425.  
  426.    ..                      The shorthand name of the current directory's
  427.                            parent directory. For example, the shorthand
  428.                            name [../..] refers to the directory that is
  429.                            two levels "above" the current directory.
  430.  
  431. ===============================================================================
  432. 2.4.4 Special Characters                               2.4.4 Special Characters
  433. ===============================================================================
  434.  
  435.    XENIX provides a facility for specifying sets of filenames that match
  436. particular patterns. Suppose, for example, you are working on a large book.
  437. The different chapters of the book might be kept in separate files, whose
  438. names might be [chpt1], [chpt2], [chpt3], and so on. You might even break
  439. each chapter into separate files. For example, you might have files named
  440. [chpt1.1], [chpt1.2], [chpt1.3], and so on.
  441.  
  442.    If you want to print the whole book on the lineprinter, you could enter
  443. the following command:
  444.  
  445.                         <lp chap1.1 chap1.2 chap1.3 ...>
  446.  
  447.    Entering so many filenames in a command quickly becomes tedious, and will
  448. probably lead to mistakes. Fortunately, there is a shortcut. A sequence of
  449. names containing a common pattern can be specified with the use of special
  450. "wildcard" characters. The wildcard characters discussed in this chapter
  451. are:
  452.  
  453.  
  454.    *                       Matches zero or more characters.
  455.  
  456.    []                      Matches any character inside the brackets.
  457.  
  458.    ?                       Matches any single character.
  459.  
  460.  
  461.    For example, you can enter:
  462.  
  463.  
  464.    <lp chap*>
  465.  
  466.  
  467.    The asterisk (*) means "zero or more characters of any type," so this
  468. command translates into "send all files whose names begin with the word
  469. [chap] to the lineprinter." This is a quick and effective way of printing
  470. all the files that make up your book.
  471.  
  472.    This shorthand notation is not a unique property of the <lp> command. It
  473. can be used with any command. For example, you can list the names of the
  474. files in the book by typing:
  475.  
  476.  
  477.    <lc chap*>
  478.  
  479.  
  480.    The asterisk is not limited to the last position in a filename. It can be
  481. used anywhere in a filename and can occur several times. An asterisk bu itself
  482. matches all filenames not containing slashes or beginning with periods:
  483.  
  484.  
  485.    <cat *>
  486.  
  487.  
  488.    This command displays all files in the current directory on your terminal
  489. screen.
  490.  
  491.    The asterisk is not the only pattern-matching feature available. Suppose
  492. you want to print only chapters 1 through 4, and 9. You can enter:
  493.  
  494.  
  495.    <lp chap[12349]*>
  496.  
  497.  
  498.    The brackets ([ and ]) mean "match any of the characters inside the
  499. brackets." A Range of consecutive letters or digits can be abbreviated, so
  500. you can also do this with the following command:
  501.  
  502.  
  503.    <lp chap[1-49]*>
  504.  
  505.  
  506.    (Note that this does Not try to match [chap1*] through [chap49*], but
  507. rather [chap1*] through [chap4*] and [chap9*].) Letters can also be used
  508. within brackets: "[a-z]" matches any character in the range "a" through "z".
  509.  
  510.    The question mark (?) matches any single character:
  511.  
  512.  
  513.    <lc ?>
  514.  
  515.  
  516.    This command lists all files that have single-character names. The fol-
  517. lowing command lists information about the first file of each chapter (i.e.,
  518. [chap1.1], [chap2.1], ...):
  519.  
  520.  
  521.    <l chap?.1>
  522.  
  523.  
  524.    If you need to turn off the special meaning of any of the wildcard
  525. characters (*, ?, and [ ... ]) enclose the entire argument in single 
  526. quotation marks. For example, the following command lists only a file named
  527. "?" rather than all one-character filenames:
  528.  
  529.  
  530.    <lc '?'>
  531.  
  532.  
  533.    Pattern-matching features are discussed further in "The Shell" chapter of
  534. the XENIX User's Guide.
  535.  
  536. ===============================================================================
  537. 2.5 Commands                                                       2.5 Commands
  538. ===============================================================================
  539.  
  540.    You have already been introduced to three useful XENIX commands, <lc>,
  541. <lp>, and <cat>. The <lc> command is used to display directory contents, the
  542. <lp> command to print files and the <cat> command to display file contents.
  543.  
  544.    Commands are executable programs. When you enter the name of a command,
  545. XENIX looks for a program with that name and executes the program, if it can
  546. be found. Command lines can also contain arguments that specify options or
  547. files that the program needs. The command line and command syntax are
  548. discussed in the next two sections.
  549.  
  550. ===============================================================================
  551. 2.5.1 Command Line                                           2.5.1 Command Line
  552. ===============================================================================
  553.  
  554.    XENIX always reads commands from the "command line." The command line is
  555. a line of characters that is read by the shell to determine what actions to
  556. perform. (XENIX offers three shells, the Bourne Shell, the C-Shell and the
  557. Visual Shell.) The shell reads the names of commands from the command line,
  558. finds the executable program corresponding to the name of the command, then
  559. execute that program. When the program finishes executing, the shell resumes
  560. reading the command line.
  561.  
  562.    When you enter commands at a terminal, you are actually editing a line of
  563. text called the "command-line buffer." The command-line buffer becomes a
  564. command line only when you press RETURN. The command-line buffer can be edited
  565. with the BKSP and Ctrl-u keys. If the INTERRUPT key is pressed before RETURN,
  566. the command-line buffer is erased. (On most keyboards, DEL key is the
  567. INTERRUPT key.)
  568.  
  569.    Multiple commands can be entered on a single command line, provided they
  570. are separated by a semicolon (;). For example, the following command line
  571. prints out the current date and the name of the current working directory:
  572.  
  573.  
  574.    <date; pwd>
  575.  
  576.  
  577.    Commands can be submitted for processing in the "background" by appending
  578. an ampersand (&) to the command line. This mode of execution is similar to
  579. "batch" processing on other systems. The main advantage of placing commands in
  580. the background is that you can execute other commands from your terminal in
  581. the "foreground" while the background commands execute. For example, the
  582. following command outputs disk usage statistics in the directory [/usr], a
  583. fairly time-consuming operation, without tying up your terminal:
  584.  
  585.  
  586.    <du /usr > diskuse &>
  587.  
  588.  
  589.    The output of this <du> command is placed in the file [diskuse], by
  590. redirecting output with the greater-than symbol <>>. (Redirection of input
  591. and output is discussed in "Input and Output" below. Background processing
  592. is discussed in "Advanced Tasks.")
  593.  
  594. ===============================================================================
  595. 2.5.2 Syntax                                                       2.5.2 Syntax
  596. ===============================================================================
  597.  
  598.    The general syntax for commands is:
  599.  
  600.  
  601.    <cmd> [options][arguments][filename][...]
  602.  
  603.  
  604.    By convention, command names are lowercase. Options are always preceded
  605. by a dash (-) and are not required. They are used to modify the command. For
  606. example, the <lc> command lists, in columnar format, the contents of a
  607. directory. The same command with the <-l> option <lc -l> produces a long
  608. listing of a directory's contents.
  609.  
  610.    In some cases, options can be grouped to form a single option argument,
  611. as in the following command:
  612.  
  613.  
  614.    <lc -rl>
  615.  
  616.  
  617.    This command is really a combination of two options, where the <-rl>
  618. option selects the option that lists all files in the directory in both
  619. reverse alphabetical order and with the long format.
  620.  
  621.    Sometimes multiple options must be given separately, as in the following
  622. command:
  623.  
  624.  
  625.    <copy -a -v source destination>
  626.  
  627.  
  628.    Here, the <-a> option tells the <copy> command to ask the user for
  629. confirmation before copying <source> to <destination>. The <-v> option
  630. specifies "verbose", which causes <copy> to list the names if the files
  631. that are copied, as they are copied.
  632.  
  633.    Other arguments, such as search strings, can also be given, as in the
  634. following command:
  635.  
  636.  
  637.    <grep 'string of text' data.file>
  638.  
  639.  
  640.    The 'string of text' in this example is a single argument, and is the
  641. string for which the <grep> command searches in the file <data.file>.
  642.  
  643. ===============================================================================
  644. 2.6 Input and Output                                       2.6 Input and Output
  645. ===============================================================================
  646.  
  647.    By default, XENIX assumes that input comes from the terminal keyboard
  648. and that output goes to the terminal screen. To illustrate typical command
  649. input and output, enter:
  650.  
  651.  
  652.    <cat>
  653.  
  654.  
  655.    This command now expects input from your keyboard. It accepts as many
  656. lines of input as you enter, until you press Ctrl-d, which is the "end-of-
  657. file" or "end-of-transmission" indicator.
  658.  
  659.    For example, enter:
  660.  
  661.  
  662.                         this is two lines RETURN
  663.                         of input RETURN
  664.                         Ctrl-d
  665.  
  666.  
  667.    The <cat> command immediately outputs each line as you enter it. Since
  668. output is sent to the terminal screen by default, that is where the lines
  669. are sent. Thus, the complete session will look like this on your terminal
  670. screen:
  671.  
  672.  
  673.               $ cat
  674.               this is two lines
  675.               this is two lines
  676.               of input
  677.               of input
  678.               $
  679.  
  680.  
  681.    The flow of command input and output can be "redirected" so that input
  682. comes from a file instead of from the terminal keyboard and output goes to a
  683. file or lineprinter, instead of to the terminal screen. In addition, you can
  684. create "pipes" to use the output of one command as the input of another.
  685. (Redirection and pipes are discussed in the next two subsections.)
  686.  
  687. ===============================================================================
  688. 2.6.1 Redirection                                             2.6.1 Redirection
  689. ===============================================================================
  690.  
  691.    In XENIX, a file can replace the terminal for either input or output. For
  692. example, the following command displays a list of files on your terminal
  693. screen:
  694.  
  695.  
  696.    <lc>
  697.  
  698.  
  699.    But if you enter the following command, a list of your files is placed in
  700. the file [filelist] (which is created if it does not already exist), rather
  701. than sent to the screen:
  702.  
  703.  
  704.    <lc > filelist>
  705.  
  706.  
  707.    The symbol for output redirection, the greater-than sign (>), means "put
  708. the output from the command into the following file, rather than display it
  709. on the terminal screen." The following command is another way of using the
  710. output redirection mechanism:
  711.  
  712.  
  713.    <cat f1 f2 f3 > temp>
  714.  
  715.  
  716.    This command places copies of several files in the file [temp] by 
  717. redirecting the output of <cat> to that file.
  718.  
  719.    The output append symbol (>>) works very much like the output redirection
  720. symbol, except that it means "add to the end of." The following command means
  721. "concatenate [file1], [file2], and [file3] to the end of whatever is already
  722. in [temp], instead of overwriting and destroying the existing contents."
  723.  
  724.  
  725.    <cat file1 file2 file3 >> temp>
  726.  
  727.  
  728.    As with normal output redirection, if [temp] doesn't already exist, it is
  729. created for you.
  730.  
  731.    In a similar way, the input redirection symbol (<> means "take the input
  732. for a program from the following file, instead of from the terminal." As an
  733. example, you could enter the following command to send a file named
  734. [letter.txt] to several people using the XENIX <mail> facility:
  735.  
  736.  
  737.    <mail adam eve mary joe < letter.txt>
  738.  
  739.  
  740.    (See Chapter 6 of this tutorial for information on <mail>.)
  741.  
  742. ===============================================================================
  743. 2.6.2 Pipes                                                         2.6.2 Pipes
  744. ===============================================================================
  745.  
  746.    One of the major innovations of the XENIX system is the concept of a
  747. "pipe." A pipe is simply a way to use the output of one command as the input
  748. of another, so that the two run as a sequence of commands called a "pipeline".
  749.  
  750.    For example, suppose that you want to find all unique lines in [frank.txt],
  751. [george.txt], and [hank.txt] and view the result. You could enter the following
  752. sequence of commands:
  753.  
  754.  
  755.                 <sort frank.txt george.txt hank.txt > temp1>
  756.                 <uniq < temp1 > temp2>
  757.                 <more temp2>
  758.                 <rm temp1 temp2>
  759.  
  760.  
  761.    But this is more work than necessary. What you want is to take the out-
  762. put of <sort> and connect it to the input of <uniq>, then take the output
  763. of <uniq> and connect it to <more>. You would use the following pipe:
  764.  
  765.  
  766.    <sort frank.txt george.txt hank.txt | uniq | more>
  767.  
  768.  
  769.    The vertical bar character (|) is used between the <sort> and <uniq>
  770. commands to indicate that the output from <sort>, which would normally have
  771. been sent to the terminal, is to be used as the input of the <uniq> command,
  772. which in turn sends its output to the <more> command for viewing.
  773.  
  774.    The following command is another example of a pipe. The <wc> command
  775. counts the number of lines, words, and characters in its input. The <who>
  776. command prints a list of users currently logged on, one per line. Thus, the
  777. following pipeline tells you the number of users who are logged in by counting
  778. the number of lines that come from the <who> command:
  779.  
  780.  
  781.    <who | wc -l>
  782.  
  783.  
  784.    Notice the difference in output between <wc -l> and <wc>. By default, <wc>
  785. tells you how many lines, words, and characters there are in the input. How-
  786. ever, <wc -l> tells you only how many lines.
  787.  
  788.    Any program that accepts input from the keyboard can accept input from a
  789. pipe instead. Any program that displays output to the terminal screen can
  790. send input to a pipe. You can have as many elements in a pipeline as you wish.
  791.  
  792.  _____________________________________________________________________________
  793.  
  794.  
  795.  4. RECOMMENDED
  796.  --------------
  797.  This section is included in every issue of The European Digest and will
  798.  contain recommended stuff/boards/reading and so on. For this file, TV
  799.  series.
  800.  
  801.  SERIE/NAME                           WHY?
  802.  ------------------------------------ --------------------------------------
  803.  Parker Lewis Can't Lose              Real Cool. The only minus is the moral
  804.                                       at the end of each episode (as with
  805.                                       ALL American series). TOTAL COOLNESS!
  806.  
  807.  Wiseguy                              Tough Drama/Action series with a lot
  808.                                       of political stuff. Like any Cop-
  809.                                       series, only higher up the ladder.
  810.  
  811.  Murphy Brown                         Candice Bergen's Comedy Success.
  812.                                       TV station comedy, always with some
  813.                                       great intro-music, and with the
  814.                                       Youngest producer, Miles. (laughter)
  815.  
  816.  21 Jump Street                       Young cops, infiltrating clubs, gangs,
  817.                                       and so on. A lot of action and moral.
  818.                                       Still a good 'Cop' series.
  819.  
  820.  Hardball                             Well.. Just started here in Sweden,
  821.                                       and so far, not so good. It's the
  822.                                       basic odd-pair cop-show really.
  823.  
  824.  The Simpsons                         The Cult (still) series. I give 10
  825.                                       points out of ten to the first 20
  826.                                       episodes. Since then I'll give it
  827.                                       a 7. Kid-Anarchy type-o.
  828.  ---------------------------------------------------------------------------
  829.  
  830.  
  831.  5. END COMMENTS
  832.  ---------------
  833.  Rumors say that the European Amiga-Warez Scene's Blue Boxing is finally
  834.  dead. I guess some of them found out 'the hard way'. Ok, this doesn't 
  835.  belong in this issue of TED, but it's news now, and not when the next
  836.  TED in released.
  837.  
  838.  The European Digest will not feature Hacking techniques, Phreaking, Carding,
  839.  information about government systems or the basic underground rap. It will 
  840.  be different. It IS different. Manuals, The Underground Scene, Deep Deep
  841.  whatever, and so on. Less 'general rag stuff' and More Miscellaneous stuff.
  842.  Swedish Hacker News will be presented through the 'uXu - Swedish News' series,
  843.  but ONLY in Swedish. English translations will however be published in other
  844.  well-known underground rags, as contributions.
  845.  
  846.  Check out the Next TED for something Completely different!
  847.  
  848.  You can reach me on the following boards for comments, contributions,
  849.  questions or whatever:
  850.  
  851.  Condemned Reality        [618-397-7702]
  852.  Land Of Karrus           [215-948-2132]
  853.  Demon Roach Underground  [806-794-4362]
  854.  Balanced pH              [818-783-5320]
  855.  Info Addict              [+46-498-22113]
  856.  
  857.  
  858.  The Chief 1991
  859.  
  860.  %&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&
  861.  %                                                                          %
  862.  &  "Congress shall make no law respecting an establishment of religion, or &
  863.  %  prohibitting the free excercise thereof; or abbridging the freedom of   %
  864.  &  speech or of the press; or of the right of the people peaceably to      &
  865.  %  assemble, and to petition the Goverment for a redress of grievances."   %
  866.  &                                                                          &
  867.  %  This work is released according to the above Constitutional rights      %
  868.  &  for INFORMATIONAL PURPOSES ONLY.                                        &
  869.  %                                                                          %
  870.  &%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
  871.  
  872.  ____________________________________________________________________________
  873.  ____________________________________________________________________________
  874.  
  875. Downloaded From P-80 International Information Systems 304-744-2253 12yrs+
  876.